<script setup lang="ts">
import moment from 'moment'
let time = ref<string>(moment().format('YYYY年MM月DD日 HH:mm:ss'))
let timer = setInterval(() => {
  time.value = moment().format('YYYY年MM月DD日 HH:mm:ss')
}, 1000)
onBeforeUnmount(() => clearInterval(timer))
</script>

<template>
  <div class="top">
    <div class="left">
      <span class="btn" @click="$router.push('/')">首页</span>
    </div>
    <div class="center">
      <div class="title">长江路社区卫生服务中心可视化大数据展示平台</div>
    </div>
    <div class="right">
      <span class="btn">统计报告</span>
      <span class="time">当前时间：{{ time }}</span>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.top {
  width: 100%;
  // height: 40px;
  display: flex;
  .left {
    flex: 1;
    height: 40px;
    background: url(../images/dataScreen-header-left-bg.png) no-repeat;
    background-size: 100% 100%;
    .btn {
      width: 120px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      color: #29fcff;
      font-size: 20px;
      float: right;
      background: url(../images/dataScreen-header-btn-bg-l.png) no-repeat;
      background-size: 100% 100%;
      cursor: pointer;
    }
  }
  .center {
    flex: 2;
    height: 74px;
    background: url(../images/dataScreen-header-center-bg.png) no-repeat;
    background-size: 100% 100%;
    .title {
      width: 100%;
      height: 74px;
      line-height: 74px;
      text-align: center;
      color: #29fcff;
      font-size: 35px;
    }
  }
  .right {
    flex: 1;
    height: 40px;
    background: url(../images/dataScreen-header-right-bg.png) no-repeat;
    background-size: 100% 100%;
    .btn {
      width: 120px;
      height: 40px;
      line-height: 40px;
      text-align: center;
      color: #29fcff;
      font-size: 20px;
      float: left;
      background: url(../images/dataScreen-header-btn-bg-r.png) no-repeat;
      background-size: 100% 100%;
    }
    .time {
      height: 40px;
      line-height: 40px;
      text-align: center;
      color: #29fcff;
      font-size: 20px;
      margin-left: 10px;
    }
  }
}
</style>
